//
// Created by Yun on 2025/2/26.
//

#ifndef CHECKER_TIME_SLICE_OS_CFG_H
#define CHECKER_TIME_SLICE_OS_CFG_H

#include <stdint.h>

/* 任务池最大数量配置 */
#define TASK_POOL_MAX_NUM 5U

/* 时间片长度配置 */
typedef enum TimeSliceOsCfg {
    TIME_SLICE_NONE = 0U,

    TIME_SLICE_1,
    TIME_SLICE_2,
    TIME_SLICE_4,
    TIME_SLICE_8,
    TIME_SLICE_16,
    TIME_SLICE_32,

    TIME_SLICE_MAX,
}TimeSliceOsCfg_TypeDef;

#define TASK_HEAD_LEN ((uint8_t)TIME_SLICE_MAX - 1)
#define TASK_CONTROL_SIZE 8 + TASK_HEAD_LEN * 8 + 16 * TASK_POOL_MAX_NUM
#define TSOS_CONTROL(name) uint8_t name[TASK_CONTROL_SIZE]

/* 时间片长度配置 */
static const uint8_t TimeSliceOS_TimeCfg[TIME_SLICE_MAX - 1] = {
        1,
        2,
        4,
        8,
        16,
        32,
};

#endif //CHECKER_TIME_SLICE_OS_CFG_H
